package a.f.d.a;

import a.a.h;
import a.a.qb;
import a.c.e;
import a.c.k;
import a.c.v;
import a.c.w;
import a.c.z;
import a.f.o;
import a.i.wb;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Map;

class q
  implements tc
{
  private int a = 250;
  private boolean b = true;
  private Comparator c;
  private long d = 10000L;
  private byte e = 0;
  private float[] f;
  private float[] g;
  private e[] h;
  private int[] i;
  private int[] j;
  private v[] k;
  private z l;
  private z m;
  private z n;
  private z o;
  private byte[] p;
  private byte[] q;
  private int[] r;
  private int[] s;
  static final byte t = -1;
  static final byte u = 0;
  static final byte v = 1;
  static final byte w = -2;
  private Comparator x;
  private Comparator y;
  private Comparator z;
  private Comparator A;
  private Comparator B;
  private Comparator C;
  private o D;
  private z[] E;
  private int[] F;
  private int[] G;
  private e[][] H;
  private e[][] I;
  private int J = 0;
  private int K = 0;
  private int L = 0;
  int[] M;
  int[] N;
  Comparator O;
  private m P;
  private Comparator Q;
  private hb R;
  public static final byte S = 0;
  public static final byte T = 1;
  final int[] U = new int[4];
  private static final byte V = 3;
  private static final byte W = 1;
  private static final byte X = 2;
  private static final byte Y = 4;
  
  void a(Map paramMap)
  {
    boolean bool = d.R;
    Object localObject = paramMap.get("SubgraphLayerSequencer.weightHeuristic");
    if (!bool)
    {
      if ((localObject instanceof Number)) {
        a(((Number)localObject).byteValue());
      }
      localObject = paramMap.get("SubgraphLayerSequencer.maximalDuration");
    }
    if (!bool)
    {
      if ((localObject instanceof Number)) {
        a(((Number)localObject).longValue());
      }
      localObject = paramMap.get("SubgraphLayerSequencer.transpositionEnabled");
    }
    if (!bool)
    {
      if ((localObject instanceof Boolean)) {
        a(((Boolean)localObject).booleanValue());
      }
      localObject = paramMap.get("SubgraphLayerSequencer.randomizationRounds");
    }
    if ((localObject instanceof Number)) {
      a(((Number)localObject).intValue());
    }
  }
  
  public void a(boolean paramBoolean)
  {
    this.b = paramBoolean;
  }
  
  public boolean a()
  {
    return this.b;
  }
  
  public void a(byte paramByte)
  {
    if (((d.R) || (paramByte != 0)) && (paramByte != 1)) {
      throw new IllegalArgumentException();
    }
    this.e = paramByte;
  }
  
  public byte b()
  {
    return this.e;
  }
  
  public long c()
  {
    return this.d;
  }
  
  public int d()
  {
    return this.a;
  }
  
  public void a(int paramInt)
  {
    this.a = paramInt;
  }
  
  public void a(long paramLong)
  {
    this.d = paramLong;
  }
  
  private cc a(o paramo, ac paramac, bc parambc, int[] paramArrayOfInt1, int[] paramArrayOfInt2)
  {
    this.p = new byte[paramo.m()];
    Arrays.fill(this.p, (byte)-2);
    this.r = new int[paramo.m()];
    this.q = new byte[paramo.m()];
    Arrays.fill(this.q, (byte)-2);
    this.s = new int[paramo.m()];
    return cc.a(paramo, paramac, parambc, paramArrayOfInt2, paramArrayOfInt1, this.p, this.r, this.q, this.s, (byte)1, (byte)0);
  }
  
  private void a(a.c.q paramq, wb paramwb)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    w localw = paramq.v();
    if (localw.e())
    {
      this.f[localw.d().f()] = paramwb.nextInt();
      localw.f();
    }
    for (;;)
    {
      if ((bool2) || (!bool1))
      {
        if (!bool1) {
          break;
        }
        if (!bool2) {
          paramq.a(new Comparator()new Comparator
          {
            public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
            {
              return l.a((int)q.this.f[((a.c.d)paramAnonymousObject1).e().f()], (int)q.this.f[((a.c.d)paramAnonymousObject2).e().f()]);
            }
          }, new Comparator()
          {
            public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
            {
              return l.a((int)q.this.f[((a.c.d)paramAnonymousObject1).f().f()], (int)q.this.f[((a.c.d)paramAnonymousObject2).f().f()]);
            }
          });
        }
      }
    }
  }
  
  private int e()
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    a(this.D, this.B, this.C);
    int i1 = 0;
    int i2 = this.E.length - 1;
    if (i2 > 0)
    {
      if (bool1) {
        break label109;
      }
      if ((this.L != 0) && ((!bool2) && ((this.H[i2] == null) && (this.H[(i2 - 1)] == null)))) {}
    }
    while (bool2)
    {
      i1 += a(this.E[(i2 - 1)], this.E[i2]);
      i2--;
      if (!bool1) {
        break;
      }
    }
    label109:
    return i1;
  }
  
  private int a(z paramz1, z paramz2)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    v localv1 = paramz1.f();
    v localv2 = paramz2.f();
    this.l.clear();
    this.m.clear();
    this.n.clear();
    this.o.clear();
    int i1 = 0;
    do
    {
      if (localv1 == null) {
        break;
      }
      if (bool1) {
        break label146;
      }
      if (localv2 == null) {
        break;
      }
      i1 += a((e)localv1.c(), this.l, this.n, this.m);
      i1 += b((e)localv2.c(), this.m, this.o, this.l);
      localv1 = localv1.a();
      localv2 = localv2.a();
    } while (!bool1);
    label146:
    label181:
    do
    {
      if ((bool2) || (localv1 == null)) {
        break;
      }
      i1 += a((e)localv1.c(), this.l, this.n, this.m);
      localv1 = localv1.a();;
      if ((!bool2) && (bool1)) {
        break label258;
      }
    } while (!bool1);
    label253:
    while (bool2)
    {
      break label253;
      if (bool2) {
        break label181;
      }
      if (localv2 != null)
      {
        if (!bool2)
        {
          if (bool1) {
            break label265;
          }
          i1 += b((e)localv2.c(), this.m, this.o, this.l);
          localv2 = localv2.a();
        }
        if (!bool1) {
          break;
        }
      }
    }
    label258:
    label265:
    return i1;
  }
  
  private int a(e parame, z paramz1, z paramz2, z paramz3)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    int i1 = this.G[parame.f()];
    int i2 = this.U[0] = this.U[1] = this.U[2] = this.U[3] = 0;
    a.c.d locald1 = parame.h();
    label193:
    label213:
    label613:
    label620:
    label622:
    do
    {
      if (locald1 == null) {
        break;
      }
      int i3;
      v localv1 = this.k[(i3 = locald1.d())];
      Object localObject;
      v localv2;
      if (localv1.c() == null)
      {
        if (!bool2) {
          if (this.F[locald1.f().f()] < 0)
          {
            if (!bool2) {}
            localObject = locald1.j() == null ? locald1.l() : locald1.j();
            localv2 = this.k[localObject.d()];
            paramz2.a(localv2);
            localv2.a(localObject);
            if (bool2) {
              break label213;
            }
            if (!bool1) {
              break label193;
            }
          }
        }
        i2 += paramz2.size();
        paramz3.a(localv1);
        localv1.a(locald1);
        this.U[(this.p[i3] + 2)] += 1;
        if ((!bool2) && (!bool1)) {}
      }
      else
      {
        if (!bool2)
        {
          if (this.F[locald1.f().f()] < 0)
          {
            paramz2.h(localv1);
            localv1.a(null);
            localObject = localv1.a();
            do
            {
              if (localObject == null) {
                break;
              }
              i2++;
              localObject = ((v)localObject).a();
              if (bool2) {
                break label622;
              }
              if (bool1) {
                break label620;
              }
            } while (!bool1);
          }
          paramz1.h(localv1);
          localv1.a(null);
        }
        int i4 = this.r[i3];
        if (bool2) {
          continue;
        }
        if (!bool2) {
          if (i4 > 0)
          {
            localv2 = localv1.b();
            if (localv2 != null)
            {
              i2++;
              localv2 = localv2.b();
            }
            for (;;)
            {
              if (!bool2) {
                if (!bool1)
                {
                  if (!bool1) {
                    break;
                  }
                  i2 += paramz3.size();
                  if (bool2) {
                    continue;
                  }
                  i2 += paramz2.size();
                }
              }
            }
            if ((!bool2) && (!bool1)) {
              break label613;
            }
          }
        }
        int i5 = this.p[i3];
        v localv3 = localv1.b();
        do
        {
          if (localv3 == null) {
            break;
          }
          a.c.d locald2;
          if (bool2) {
            break label527;
          }
          if (bool1) {
            break label522;
          }
          if (this.G[(locald2 = (a.c.d)localv3.c()).e().f()] <= i1)
          {
            if (bool2) {
              continue;
            }
            if (i5 != -2)
            {
              if (bool2) {
                continue;
              }
              if (this.p[locald2.d()] <= i5) {}
            }
          }
          else
          {
            i2++;
          }
          localv3 = localv3.b();
        } while (!bool1);
        if (!bool2) {}
        i2 += paramz3.size() + paramz2.size();
        if (!bool2) {}
        switch (i5)
        {
        case -1: 
          i2 -= this.U[1];
          if (!bool2) {
            if (!bool1) {
              break label613;
            }
          }
        case 0: 
          i2 -= this.U[2];
          if ((!bool2) && (!bool1)) {}
          break;
        case 1: 
          i2 -= this.U[3];
        }
      }
      locald1 = locald1.i();
    } while (!bool1);
    label522:
    label527:
    return i2;
  }
  
  private int b(e parame, z paramz1, z paramz2, z paramz3)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    int i1 = this.G[parame.f()];
    int i2 = this.U[0] = this.U[1] = this.U[2] = this.U[3] = 0;
    a.c.d locald1 = parame.i();
    label193:
    label213:
    label609:
    label616:
    label618:
    do
    {
      if (locald1 == null) {
        break;
      }
      int i3;
      v localv1 = this.k[(i3 = locald1.d())];
      Object localObject;
      v localv2;
      if (localv1.c() == null)
      {
        if (!bool2) {
          if (this.F[locald1.e().f()] < 0)
          {
            if (!bool2) {}
            localObject = locald1.i() == null ? locald1.k() : locald1.i();
            localv2 = this.k[localObject.d()];
            paramz2.a(localv2);
            localv2.a(localObject);
            if (bool2) {
              break label213;
            }
            if (!bool1) {
              break label193;
            }
          }
        }
        i2 += paramz2.size();
        paramz3.a(localv1);
        localv1.a(locald1);
        this.U[(this.q[i3] + 2)] += 1;
        if ((!bool2) && (!bool1)) {}
      }
      else
      {
        if (!bool2)
        {
          if (this.F[locald1.e().f()] < 0)
          {
            paramz2.h(localv1);
            localv1.a(null);
            localObject = localv1.a();
            do
            {
              if (localObject == null) {
                break;
              }
              i2++;
              localObject = ((v)localObject).a();
              if (bool2) {
                break label618;
              }
              if (bool1) {
                break label616;
              }
            } while (!bool1);
          }
          paramz1.h(localv1);
          localv1.a(null);
        }
        int i4 = this.s[i3];
        if (bool2) {
          continue;
        }
        if (!bool2) {
          if (i4 > 0)
          {
            localv2 = localv1.b();
            if (localv2 != null)
            {
              i2++;
              localv2 = localv2.b();
            }
            for (;;)
            {
              if (!bool2) {
                if (!bool1)
                {
                  if (!bool1) {
                    break;
                  }
                  if (bool2) {
                    continue;
                  }
                  i2 += paramz3.size() + paramz2.size();
                }
              }
            }
            if ((!bool2) && (!bool1)) {
              break label609;
            }
          }
        }
        int i5 = this.q[i3];
        v localv3 = localv1.b();
        do
        {
          if (localv3 == null) {
            break;
          }
          a.c.d locald2;
          if (bool2) {
            break label523;
          }
          if (bool1) {
            break label518;
          }
          if (this.G[(locald2 = (a.c.d)localv3.c()).f().f()] <= i1)
          {
            if (bool2) {
              continue;
            }
            if (i5 != -2)
            {
              if (bool2) {
                continue;
              }
              if (this.q[locald2.d()] <= i5) {}
            }
          }
          else
          {
            i2++;
          }
          localv3 = localv3.b();
        } while (!bool1);
        if (!bool2) {}
        i2 += paramz3.size() + paramz2.size();
        if (!bool2) {}
        switch (i5)
        {
        case -1: 
          i2 -= this.U[1];
          if (!bool2) {
            if (!bool1) {
              break label609;
            }
          }
        case 0: 
          i2 -= this.U[2];
          if ((!bool2) && (!bool1)) {}
          break;
        case 1: 
          i2 -= this.U[3];
        }
      }
      locald1 = locald1.j();
    } while (!bool1);
    label518:
    label523:
    return i2;
  }
  
  private byte a(int[] paramArrayOfInt)
  {
    return a(0, this.E.length - 1, paramArrayOfInt);
  }
  
  private byte a(int paramInt1, int paramInt2, int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    byte b1 = 0;
    if (!bool2) {
      if (paramInt1 <= paramInt2)
      {
        i1 = 1;
        i2 = 20;
        do
        {
          while (i3 > paramInt2)
          {
            if (i1 == 0) {
              break;
            }
            i2--;
            if (bool2) {
              break label276;
            }
            if (i2 <= 0) {
              break;
            }
            i1 = 0;
            i3 = paramInt1;
          }
          if ((bool2) || (this.H[i3] != null))
          {
            localz = this.E[i3];
            a(localz, this.A, this.z);
            b2 = a(i3, localz, true, true, paramArrayOfInt);
            if (!bool2) {}
            i1 = (b2 & 0x4) != 0 ? 1 : 0;
            b1 = (byte)(b1 | b2);
          }
          i3++;
        } while (!bool1);
      }
    }
    int i1 = 1;
    int i2 = 20;
    while (bool2) {
      do
      {
        int i3;
        z localz;
        byte b2;
        do
        {
          if (i1 == 0) {
            break;
          }
          i2--;
          if (bool2) {
            break label276;
          }
          if (i2 <= 0) {
            break;
          }
          i1 = 0;
          i3 = paramInt1;
        } while (i3 < paramInt2);
        if ((bool2) || (this.H[i3] != null))
        {
          localz = this.E[i3];
          a(localz, this.A, this.z);
          b2 = a(i3, localz, true, true, paramArrayOfInt);
          if (!bool2) {}
          i1 = (b2 & 0x4) != 0 ? 1 : 0;
          b1 = (byte)(b1 | b2);
        }
        i3--;
      } while (!bool1);
    }
    label276:
    return b1;
  }
  
  private byte a(int paramInt, z paramz, boolean paramBoolean1, boolean paramBoolean2, int[] paramArrayOfInt)
  {
    boolean bool = d.R;
    if (!bool) {
      if (this.L > 0)
      {
        if (bool) {
          break label34;
        }
        if (this.H[paramInt] == null) {
          return 0;
        }
      }
    }
    label34:
    int i1 = a(paramz, paramBoolean1, paramBoolean2, paramArrayOfInt);
    int i2 = c(paramz, paramBoolean1, paramBoolean2, paramArrayOfInt);
    return (byte)(i1 | i2);
  }
  
  private byte a(z paramz, boolean paramBoolean1, boolean paramBoolean2, int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    int i1 = 0;
    int i2 = 0;
    int i3 = 0;
    v localv1 = paramz.f();
    int i4 = 0;
    label224:
    label225:
    label231:
    do
    {
      if (i4 >= paramz.size() - 1) {
        break;
      }
      v localv2 = localv1;
      localv1 = localv2.a();
      e locale1 = (e)localv2.c();
      e locale2 = (e)localv1.c();
      if (bool1) {
        break label800;
      }
      if ((this.L <= 0) || ((bool2) || ((a(locale1)) || ((bool2) || (a(locale2))))))
      {
        if (!bool2) {
          if (this.P != null)
          {
            if (bool2) {
              break label225;
            }
            if (!this.P.a(this.D, locale1, locale2)) {
              break label224;
            }
            break label785;
          }
        }
        if ((bool2) || (this.M != null))
        {
          i5 = this.M[locale1.f()];
          i6 = this.M[locale2.f()];
          if (bool2) {
            break label231;
          }
          if (i5 >= 0)
          {
            if (bool2) {
              break label231;
            }
            if (i6 >= 0)
            {
              if (bool2) {
                break label231;
              }
              if (i5 != i6) {
                break label785;
              }
            }
          }
        }
        int i5 = 0;
        int i6 = 0;
        if (!bool2) {
          if (paramBoolean1)
          {
            i5 = e(locale1, locale2, paramArrayOfInt);
            if (!bool2) {
              if (!paramBoolean2)
              {
                if (bool2) {
                  break label283;
                }
                if (i5 <= 0) {
                  break label282;
                }
              }
            }
            i6 = e(locale2, locale1, paramArrayOfInt);
          }
        }
        if (!bool2) {
          if (paramBoolean2)
          {
            i5 += d(locale1, locale2, paramArrayOfInt);
            if (!bool2) {
              if (!paramBoolean1)
              {
                if (bool2) {
                  break label342;
                }
                if (i5 <= 0) {
                  break label340;
                }
              }
            }
            i6 += d(locale2, locale1, paramArrayOfInt);
          }
        }
        if (bool2) {
          continue;
        }
        if (i5 >= i6)
        {
          if (!bool2) {
            if (i5 > i6)
            {
              i1 = 1;
              i7 = paramArrayOfInt[locale1.f()];
              paramArrayOfInt[locale1.f()] = paramArrayOfInt[locale2.f()];
              paramArrayOfInt[locale2.f()] = i7;
              localv1.a(locale1);
              localv2.a(locale2);
              if (!bool2) {
                if (locale1.e() <= 0) {
                  if (bool2) {
                    break label446;
                  }
                }
              }
              i2 |= (locale2.e() > 0 ? 1 : 0);
              if (!bool2) {
                if (locale1.d() <= 0) {
                  if (bool2) {
                    break label482;
                  }
                }
              }
              i3 |= (locale2.d() > 0 ? 1 : 0);
              a(locale1, paramBoolean1 ? this.A : null, paramBoolean2 ? this.z : null, true);
              a(locale2, paramBoolean1 ? this.A : null, paramBoolean2 ? this.z : null, false);
              if (bool2) {
                continue;
              }
              if (!bool1) {
                break label785;
              }
            }
          }
          int i7 = a(locale1, locale2, true, true, paramArrayOfInt);
          int i8 = a(locale2, locale1, true, true, paramArrayOfInt);
          if (bool2) {
            continue;
          }
          if (i8 < i7)
          {
            int i9 = paramArrayOfInt[locale1.f()];
            paramArrayOfInt[locale1.f()] = paramArrayOfInt[locale2.f()];
            paramArrayOfInt[locale2.f()] = i9;
            localv1.a(locale1);
            localv2.a(locale2);
            if (!bool2) {
              if (locale1.e() <= 0) {
                if (bool2) {
                  break label680;
                }
              }
            }
            i2 |= (locale2.e() > 0 ? 1 : 0);
            if (!bool2) {
              if (locale1.d() <= 0) {
                if (bool2) {
                  break label716;
                }
              }
            }
            i3 |= (locale2.d() > 0 ? 1 : 0);
            a(locale1, paramBoolean1 ? this.A : null, paramBoolean2 ? this.z : null, true);
            a(locale2, paramBoolean1 ? this.A : null, paramBoolean2 ? this.z : null, false);
          }
        }
      }
      i4++;
    } while (!bool1);
    label282:
    label283:
    label340:
    label342:
    label482:
    if (!bool2) {}
    label446:
    label716:
    if (!bool2) {}
    label680:
    return (byte)(((!bool2) && (i1 != 0) ? 4 : 0) | (i3 != 0 ? 2 : 0) | (i2 != 0 ? 1 : 0));
  }
  
  private byte c(z paramz, boolean paramBoolean1, boolean paramBoolean2, int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    int i1 = 0;
    int i2 = 0;
    int i3 = 0;
    v localv1 = paramz.g();
    int i4 = paramz.size() - 2;
    label223:
    label224:
    label230:
    label745:
    do
    {
      if (i4 < 0) {
        break;
      }
      v localv2 = localv1;
      localv1 = localv1.b();
      e locale1 = (e)localv1.c();
      e locale2 = (e)localv2.c();
      if (bool1) {
        break label829;
      }
      if ((this.L <= 0) || ((bool2) || ((a(locale1)) || ((bool2) || (a(locale2))))))
      {
        if (!bool2) {
          if (this.P != null)
          {
            if (bool2) {
              break label224;
            }
            if (!this.P.a(this.D, locale1, locale2)) {
              break label223;
            }
            break label814;
          }
        }
        if ((bool2) || (this.M != null))
        {
          i5 = this.M[locale1.f()];
          i6 = this.M[locale2.f()];
          if (bool2) {
            break label230;
          }
          if (i5 >= 0)
          {
            if (bool2) {
              break label230;
            }
            if (i6 >= 0)
            {
              if (bool2) {
                break label230;
              }
              if (i5 != i6) {
                break label814;
              }
            }
          }
        }
        int i5 = 0;
        int i6 = 0;
        if (!bool2) {
          if (paramBoolean1)
          {
            i5 = e(locale1, locale2, paramArrayOfInt);
            if (!bool2) {
              if (!paramBoolean2)
              {
                if (bool2) {
                  break label282;
                }
                if (i5 <= 0) {
                  break label281;
                }
              }
            }
            i6 = e(locale2, locale1, paramArrayOfInt);
          }
        }
        if (!bool2) {
          if (paramBoolean2)
          {
            i5 += d(locale1, locale2, paramArrayOfInt);
            if (!bool2) {
              if (!paramBoolean1)
              {
                if (bool2) {
                  break label341;
                }
                if (i5 <= 0) {
                  break label339;
                }
              }
            }
            i6 += d(locale2, locale1, paramArrayOfInt);
          }
        }
        if (bool2) {
          continue;
        }
        if (i5 >= i6)
        {
          if (!bool2) {
            if (i5 > i6)
            {
              i1 = 1;
              i7 = paramArrayOfInt[locale1.f()];
              paramArrayOfInt[locale1.f()] = paramArrayOfInt[locale2.f()];
              paramArrayOfInt[locale2.f()] = i7;
              localv2.a(locale1);
              localv1.a(locale2);
              if (!bool2) {
                if (locale1.e() <= 0) {
                  if (bool2) {
                    break label445;
                  }
                }
              }
              i2 |= (locale2.e() > 0 ? 1 : 0);
              if (!bool2) {
                if (locale1.d() <= 0) {
                  if (bool2) {
                    break label481;
                  }
                }
              }
              i3 |= (locale2.d() > 0 ? 1 : 0);
              a(locale1, paramBoolean1 ? this.A : null, paramBoolean2 ? this.z : null, true);
              a(locale2, paramBoolean1 ? this.A : null, paramBoolean2 ? this.z : null, false);
              if (bool2) {
                continue;
              }
              if (!bool1) {
                break label814;
              }
            }
          }
          int i7 = a(locale1, locale2, true, true, paramArrayOfInt);
          int i8 = a(locale2, locale1, true, true, paramArrayOfInt);
          if (!bool2) {
            if (i8 >= i7)
            {
              if (bool2) {
                continue;
              }
              if (i8 != i7) {
                break label814;
              }
              if (bool2) {
                continue;
              }
              if (!paramBoolean1) {
                break label814;
              }
              if (bool2) {
                continue;
              }
              if (!paramBoolean2) {
                break label814;
              }
            }
          }
          int i9 = paramArrayOfInt[locale1.f()];
          paramArrayOfInt[locale1.f()] = paramArrayOfInt[locale2.f()];
          paramArrayOfInt[locale2.f()] = i9;
          localv2.a(locale1);
          localv1.a(locale2);
          if (!bool2) {
            if (locale1.e() <= 0) {
              if (bool2) {
                break label709;
              }
            }
          }
          i2 |= (locale2.e() > 0 ? 1 : 0);
          if (!bool2) {
            if (locale1.d() <= 0) {
              if (bool2) {
                break label745;
              }
            }
          }
          i3 |= (locale2.d() > 0 ? 1 : 0);
          a(locale1, paramBoolean1 ? this.A : null, paramBoolean2 ? this.z : null, true);
          a(locale2, paramBoolean1 ? this.A : null, paramBoolean2 ? this.z : null, false);
        }
      }
      i4--;
    } while (!bool1);
    label281:
    label282:
    label339:
    label341:
    label481:
    if (!bool2) {}
    label445:
    label709:
    if (!bool2) {}
    label814:
    label829:
    return (byte)(((!bool2) && (i1 != 0) ? 4 : 0) | (i3 != 0 ? 2 : 0) | (i2 != 0 ? 1 : 0));
  }
  
  private void a(e parame, Comparator paramComparator1, Comparator paramComparator2, boolean paramBoolean)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    a.c.d locald1;
    a.c.d locald2;
    if (paramBoolean)
    {
      if (!bool2)
      {
        if ((paramComparator1 != null) && ((bool2) || (parame.d() > 1)))
        {
          locald1 = parame.i();
          locald2 = parame.k();
          do
          {
            if (paramComparator1.compare(locald1, locald2) <= 0) {
              break;
            }
            if (bool1) {
              break label164;
            }
            if (locald2.i() != null)
            {
              this.D.a(locald2, locald2.i(), locald1, 1, 1);
              if (bool2) {
                continue;
              }
              if (!bool1) {}
            }
            else
            {
              this.D.a(locald2, locald2.k(), locald1, 0, 1);
            }
            locald2 = parame.k();
          } while (!bool1);
        }
        if (bool2) {
          break label245;
        }
      }
      if (paramComparator2 == null) {
        return;
      }
      if ((!bool2) && (parame.e() <= 1)) {
        return;
      }
      locald1 = parame.h();
      label164:
      locald2 = parame.j();
      do
      {
        if (paramComparator2.compare(locald1, locald2) <= 0) {
          break;
        }
        if (locald2.j() != null)
        {
          this.D.a(locald2, locald1, locald2.j(), 1, 1);
          if (bool2) {
            continue;
          }
          if (!bool1) {}
        }
        else
        {
          this.D.a(locald2, locald1, locald2.l(), 1, 0);
        }
        locald2 = parame.j();
      } while (!bool1);
    }
    label245:
    if (!bool2) {
      if ((paramComparator1 != null) && ((bool2) || (parame.d() > 1)))
      {
        locald1 = parame.k();
        locald2 = parame.i();
        do
        {
          if (paramComparator1.compare(locald2, locald1) <= 0) {
            break;
          }
          if (bool1) {
            break label393;
          }
          if (locald2.i() != null)
          {
            this.D.a(locald2, locald2.i(), locald1, 1, 0);
            if (bool2) {
              continue;
            }
            if (!bool1) {}
          }
          else
          {
            this.D.a(locald2, locald2.k(), locald1, 0, 0);
          }
          locald2 = parame.i();
        } while (!bool1);
      }
    }
    if ((!bool2) && (paramComparator2 != null)) {
      if ((bool2) || (parame.e() > 1))
      {
        locald1 = parame.j();
        label393:
        locald2 = parame.h();
        do
        {
          if (paramComparator2.compare(locald2, locald1) <= 0) {
            break;
          }
          if (locald2.j() != null)
          {
            this.D.a(locald2, locald1, locald2.j(), 0, 1);
            if (bool2) {
              continue;
            }
            if (!bool1) {}
          }
          else
          {
            this.D.a(locald2, locald1, locald2.l(), 0, 0);
          }
          locald2 = parame.h();
        } while (!bool1);
      }
    }
  }
  
  private int a(e parame1, e parame2, boolean paramBoolean1, boolean paramBoolean2, int[] paramArrayOfInt)
  {
    boolean bool = d.R;
    int i1 = 0;
    if (!bool) {
      if (paramBoolean1) {
        i1 = a(parame1, parame2, paramArrayOfInt);
      }
    }
    if (!bool) {
      if (paramBoolean2) {
        i1 += c(parame1, parame2, paramArrayOfInt);
      }
    }
    return i1;
  }
  
  private int a(e parame1, e parame2, int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    int i1 = 0;
    int i2 = paramArrayOfInt[parame1.f()];
    a.c.d locald = parame1.i();
    do
    {
      while (!bool1)
      {
        if (locald == null) {
          break;
        }
        if (bool1) {
          break label163;
        }
        if (this.F[locald.e().f()] < 0)
        {
          if (!bool2) {}
          e locale = locald.i() == null ? locald.k().f() : locald.i().f();
          if (bool2) {
            continue;
          }
          if (locale != parame2)
          {
            int i3 = paramArrayOfInt[locale.f()] - i2;
            if (!bool2) {}
            if (!bool2) {}
            i1 += (i3 < 0 ? -1 : i3 > 0 ? 1 : 0);
          }
        }
        locald = locald.j();
      }
    } while (bool2);
    label163:
    return i1;
  }
  
  private int c(e parame1, e parame2, int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    int i1 = 0;
    int i2 = paramArrayOfInt[parame1.f()];
    a.c.d locald = parame1.h();
    do
    {
      while (!bool1)
      {
        if (locald == null) {
          break;
        }
        if (bool1) {
          break label163;
        }
        if (this.F[locald.f().f()] < 0)
        {
          if (!bool2) {}
          e locale = locald.j() == null ? locald.l().e() : locald.j().e();
          if (bool2) {
            continue;
          }
          if (locale != parame2)
          {
            int i3 = paramArrayOfInt[locale.f()] - i2;
            if (!bool2) {}
            if (!bool2) {}
            i1 += (i3 < 0 ? -1 : i3 > 0 ? 1 : 0);
          }
        }
        locald = locald.i();
      }
    } while (bool2);
    label163:
    return i1;
  }
  
  private int d(e parame1, e parame2, int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    a.c.d locald1 = parame1.h();
    a.c.d locald2 = parame2.h();
    int i1 = 0;
    int i2 = 0;
    label504:
    label510:
    label639:
    do
    {
      do
      {
        Object localObject;
        int i6;
        int i9;
        int i10;
        int i11;
        do
        {
          e locale2;
          a.c.d locald3;
          e locale3;
          do
          {
            do
            {
              if (locald1 == null) {
                break label897;
              }
              if (bool1) {
                break label909;
              }
              if (locald2 == null) {
                break label897;
              }
              i3 = 1;
              if (bool2) {
                break label531;
              }
              if (this.F[locald1.f().f()] >= 0) {
                break label518;
              }
              if (!bool2) {}
              localObject = locald1.j() == null ? locald1.l() : locald1.j();
              locale2 = ((a.c.d)localObject).e();
              if (!bool2)
              {
                if (locale2 != parame2) {
                  break;
                }
                locald1 = locald1.i();
              }
            } while ((!bool2) && (!bool1));
            if (!bool2) {}
            i6 = paramArrayOfInt[locale2.f()] < paramArrayOfInt[parame1.f()] ? 1 : 0;
            if (bool2) {
              break label510;
            }
            if (this.F[locald2.f().f()] >= 0) {
              break label504;
            }
            if (!bool2) {}
            locald3 = locald2.j() == null ? locald2.l() : locald2.j();
            locale3 = locald3.e();
            if (!bool2)
            {
              if (locale3 != parame1) {
                break;
              }
              locald2 = locald2.i();
            }
          } while ((!bool2) && (!bool1));
          if (!bool2) {}
          i9 = paramArrayOfInt[locale3.f()] < paramArrayOfInt[parame2.f()] ? 1 : 0;
          if (!bool2)
          {
            if (i9 == i6)
            {
              i10 = paramArrayOfInt[locale2.f()] - paramArrayOfInt[locale3.f()];
              if (!bool2) {
                if (i10 == 0)
                {
                  int i13 = this.p[(i11 = ((a.c.d)localObject).d())];
                  int i12;
                  int i14 = this.p[(i12 = locald3.d())];
                  if (bool2) {
                    break label850;
                  }
                  if (i13 == -2) {
                    break label848;
                  }
                  if (bool2) {
                    break label850;
                  }
                  if (i14 == -2) {
                    break label848;
                  }
                  if (!bool2)
                  {
                    if (i13 < i14)
                    {
                      i3 = 0;
                      if (bool2) {
                        break label850;
                      }
                      if (!bool1) {
                        break label848;
                      }
                    }
                    if (bool2) {
                      break label850;
                    }
                  }
                  if (i13 != i14) {
                    break label848;
                  }
                  int i15 = this.r[i11];
                  int i16 = this.r[i12];
                  if (bool2) {
                    break label850;
                  }
                  if (i15 == 0) {
                    break label848;
                  }
                  if (bool2) {
                    break label850;
                  }
                  if (i16 == 0) {
                    break label848;
                  }
                  if (bool2) {
                    break label850;
                  }
                  if (i15 >= i16) {
                    break label848;
                  }
                  i3 = 0;
                  if (bool2) {
                    break label850;
                  }
                  if (!bool1) {
                    break label848;
                  }
                }
              }
              if (!bool2) {}
              i3 = i10 > 0 ? 1 : 0;
              if (bool2) {
                break label850;
              }
              if (!bool1) {
                break label848;
              }
            }
            i3 = i6;
          }
          if (bool2) {
            break label850;
          }
          if (!bool1) {
            break label848;
          }
          i3 = i6;
          if (bool2) {
            break label850;
          }
          if (!bool1) {
            break label848;
          }
          if (bool2) {
            break label649;
          }
          if (this.F[locald2.f().f()] >= 0) {
            break label639;
          }
          if (!bool2) {}
          localObject = locald2.j() == null ? locald2.l().e() : locald2.j().e();
          if (!bool2)
          {
            if (localObject != parame1) {
              break;
            }
            locald2 = locald2.i();
          }
        } while ((!bool2) && (!bool1));
        if (!bool2) {}
        int i3 = paramArrayOfInt[localObject.f()] >= paramArrayOfInt[parame1.f()] ? 1 : 0;
        if (!bool2) {
          if (bool1)
          {
            int i4 = paramArrayOfInt[locald1.f().f()];
            int i5 = paramArrayOfInt[locald2.f().f()];
            if (!bool2)
            {
              if (i4 == i5)
              {
                int i8 = this.q[(i6 = locald1.d())];
                int i7;
                i9 = this.q[(i7 = locald2.d())];
                if (bool2) {
                  break label850;
                }
                if (i8 == -2) {
                  break label848;
                }
                if (bool2) {
                  break label850;
                }
                if (i9 == -2) {
                  break label848;
                }
                if (!bool2)
                {
                  if (i8 > i9)
                  {
                    i3 = 0;
                    if (bool2) {
                      break label850;
                    }
                    if (!bool1) {
                      break label848;
                    }
                  }
                  if (bool2) {
                    break label850;
                  }
                }
                if (i8 != i9) {
                  break label848;
                }
                i10 = this.s[i6];
                i11 = this.s[i7];
                if (bool2) {
                  break label850;
                }
                if (i10 == 0) {
                  break label848;
                }
                if (bool2) {
                  break label850;
                }
                if (i11 == 0) {
                  break label848;
                }
                if (bool2) {
                  break label850;
                }
                if (i10 <= i11) {
                  break label848;
                }
                i3 = 0;
                if (bool2) {
                  break label850;
                }
                if (!bool1) {
                  break label848;
                }
              }
              if (bool2) {
                break label842;
              }
            }
            i3 = i4 < i5 ? 1 : 0;
          }
        }
        if (bool2) {
          break label894;
        }
        if (i3 == 0) {
          break;
        }
        i2 += i1;
        locald1 = locald1.i();
        if (bool2) {
          break label894;
        }
      } while (!bool1);
      i1++;
      locald2 = locald2.i();
    } while (!bool1);
    label518:
    label531:
    label842:
    label848:
    label850:
    label894:
    if (!bool2)
    {
      if ((i1 > 0) && (locald1 != null))
      {
        if (bool1) {
          break label1021;
        }
        if (this.F[locald1.f().f()] < 0)
        {
          if (!bool2) {}
          locale1 = locald1.j() == null ? locald1.l().e() : locald1.j().e();
          if (bool2) {
            break label1009;
          }
          if (locale1 == parame2) {
            break label1002;
          }
          i2 += i1;
          if (bool2) {
            break label1011;
          }
          if (!bool1) {
            break label1002;
          }
        }
      }
      while (bool2)
      {
        e locale1;
        i2 += i1;
        locald1 = locald1.i();
        if (!bool1) {
          break;
        }
      }
    }
    label649:
    label909:
    label1002:
    label1009:
    label1011:
    label1021:
    return i2;
  }
  
  private int e(e parame1, e parame2, int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    a.c.d locald1 = parame1.i();
    a.c.d locald2 = parame2.i();
    int i1 = 0;
    int i2 = 0;
    label504:
    label510:
    label639:
    do
    {
      do
      {
        Object localObject;
        int i6;
        int i9;
        int i10;
        int i11;
        do
        {
          e locale2;
          a.c.d locald3;
          e locale3;
          do
          {
            do
            {
              if (locald1 == null) {
                break label897;
              }
              if (bool1) {
                break label909;
              }
              if (locald2 == null) {
                break label897;
              }
              i3 = 1;
              if (bool2) {
                break label531;
              }
              if (this.F[locald1.e().f()] >= 0) {
                break label518;
              }
              if (!bool2) {}
              localObject = locald1.i() == null ? locald1.k() : locald1.i();
              locale2 = ((a.c.d)localObject).f();
              if (!bool2)
              {
                if (locale2 != parame2) {
                  break;
                }
                locald1 = locald1.j();
              }
            } while ((!bool2) && (!bool1));
            if (!bool2) {}
            i6 = paramArrayOfInt[locale2.f()] < paramArrayOfInt[parame1.f()] ? 1 : 0;
            if (bool2) {
              break label510;
            }
            if (this.F[locald2.e().f()] >= 0) {
              break label504;
            }
            if (!bool2) {}
            locald3 = locald2.i() == null ? locald2.k() : locald2.i();
            locale3 = locald3.f();
            if (!bool2)
            {
              if (locale3 != parame1) {
                break;
              }
              locald2 = locald2.j();
            }
          } while ((!bool2) && (!bool1));
          if (!bool2) {}
          i9 = paramArrayOfInt[locale3.f()] < paramArrayOfInt[parame2.f()] ? 1 : 0;
          if (!bool2)
          {
            if (i9 == i6)
            {
              i10 = paramArrayOfInt[locale2.f()] - paramArrayOfInt[locale3.f()];
              if (!bool2) {
                if (i10 == 0)
                {
                  int i13 = this.q[(i11 = ((a.c.d)localObject).d())];
                  int i12;
                  int i14 = this.q[(i12 = locald3.d())];
                  if (bool2) {
                    break label850;
                  }
                  if (i13 == -2) {
                    break label848;
                  }
                  if (bool2) {
                    break label850;
                  }
                  if (i14 == -2) {
                    break label848;
                  }
                  if (!bool2)
                  {
                    if (i13 < i14)
                    {
                      i3 = 0;
                      if (bool2) {
                        break label850;
                      }
                      if (!bool1) {
                        break label848;
                      }
                    }
                    if (bool2) {
                      break label850;
                    }
                  }
                  if (i13 != i14) {
                    break label848;
                  }
                  int i15 = this.s[i11];
                  int i16 = this.s[i12];
                  if (bool2) {
                    break label850;
                  }
                  if (i15 == 0) {
                    break label848;
                  }
                  if (bool2) {
                    break label850;
                  }
                  if (i16 == 0) {
                    break label848;
                  }
                  if (bool2) {
                    break label850;
                  }
                  if (i15 >= i16) {
                    break label848;
                  }
                  i3 = 0;
                  if (bool2) {
                    break label850;
                  }
                  if (!bool1) {
                    break label848;
                  }
                }
              }
              if (!bool2) {}
              i3 = i10 > 0 ? 1 : 0;
              if (bool2) {
                break label850;
              }
              if (!bool1) {
                break label848;
              }
            }
            i3 = i6;
          }
          if (bool2) {
            break label850;
          }
          if (!bool1) {
            break label848;
          }
          i3 = i6;
          if (bool2) {
            break label850;
          }
          if (!bool1) {
            break label848;
          }
          if (bool2) {
            break label649;
          }
          if (this.F[locald2.e().f()] >= 0) {
            break label639;
          }
          if (!bool2) {}
          localObject = locald2.i() == null ? locald2.k().f() : locald2.i().f();
          if (!bool2)
          {
            if (localObject != parame1) {
              break;
            }
            locald2 = locald2.j();
          }
        } while ((!bool2) && (!bool1));
        if (!bool2) {}
        int i3 = paramArrayOfInt[localObject.f()] >= paramArrayOfInt[parame1.f()] ? 1 : 0;
        if (!bool2) {
          if (bool1)
          {
            int i4 = paramArrayOfInt[locald1.e().f()];
            int i5 = paramArrayOfInt[locald2.e().f()];
            if (!bool2)
            {
              if (i4 == i5)
              {
                int i8 = this.p[(i6 = locald1.d())];
                int i7;
                i9 = this.p[(i7 = locald2.d())];
                if (bool2) {
                  break label850;
                }
                if (i8 == -2) {
                  break label848;
                }
                if (bool2) {
                  break label850;
                }
                if (i9 == -2) {
                  break label848;
                }
                if (!bool2)
                {
                  if (i8 > i9)
                  {
                    i3 = 0;
                    if (bool2) {
                      break label850;
                    }
                    if (!bool1) {
                      break label848;
                    }
                  }
                  if (bool2) {
                    break label850;
                  }
                }
                if (i8 != i9) {
                  break label848;
                }
                i10 = this.r[i6];
                i11 = this.r[i7];
                if (bool2) {
                  break label850;
                }
                if (i10 == 0) {
                  break label848;
                }
                if (bool2) {
                  break label850;
                }
                if (i11 == 0) {
                  break label848;
                }
                if (bool2) {
                  break label850;
                }
                if (i10 <= i11) {
                  break label848;
                }
                i3 = 0;
                if (bool2) {
                  break label850;
                }
                if (!bool1) {
                  break label848;
                }
              }
              if (bool2) {
                break label842;
              }
            }
            i3 = i4 < i5 ? 1 : 0;
          }
        }
        if (bool2) {
          break label894;
        }
        if (i3 == 0) {
          break;
        }
        i2 += i1;
        locald1 = locald1.j();
        if (bool2) {
          break label894;
        }
      } while (!bool1);
      i1++;
      locald2 = locald2.j();
    } while (!bool1);
    label518:
    label531:
    label842:
    label848:
    label850:
    label894:
    if (!bool2)
    {
      if ((i1 > 0) && (locald1 != null))
      {
        if (bool1) {
          break label1021;
        }
        if (this.F[locald1.e().f()] < 0)
        {
          if (!bool2) {}
          locale1 = locald1.i() == null ? locald1.k().f() : locald1.i().f();
          if (bool2) {
            break label1009;
          }
          if (locale1 == parame2) {
            break label1002;
          }
          i2 += i1;
          if (bool2) {
            break label1011;
          }
          if (!bool1) {
            break label1002;
          }
        }
      }
      while (bool2)
      {
        e locale1;
        i2 += i1;
        locald1 = locald1.j();
        if (!bool1) {
          break;
        }
      }
    }
    label649:
    label909:
    label1002:
    label1009:
    label1011:
    label1021:
    return i2;
  }
  
  private boolean a(o paramo, ac paramac, k paramk)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    e[][] arrayOfe;1 = new e[paramac.a()][];
    e[][] arrayOfe;2 = new e[paramac.a()][];
    int i1 = 2147483647;
    int i2 = 0;
    int i3 = 0;
    ArrayList localArrayList1 = new ArrayList(120);
    ArrayList localArrayList2 = new ArrayList(120);
    int i4 = 0;
    label196:
    label211:
    do
    {
      do
      {
        if (i4 >= paramac.a()) {
          break;
        }
        localArrayList1.clear();
        localArrayList2.clear();
        if (bool2) {
          break label392;
        }
        if (bool1) {
          break label391;
        }
        Object localObject = paramac.a(i4).c().f();
        if (localObject != null) {}
        while (bool2)
        {
          e locale = (e)((v)localObject).c();
          if (bool1) {
            break label211;
          }
          if (paramk.getBool(locale))
          {
            localArrayList1.add(locale);
            paramo.g(locale);
            if (bool2) {
              break label196;
            }
            if (!bool1) {}
          }
          else
          {
            localArrayList2.add(locale);
          }
          localObject = ((v)localObject).a();
          if (!bool1) {
            break;
          }
        }
        if (localArrayList1.size() > 0)
        {
          if (!bool2) {
            if (localArrayList2.size() > 0)
            {
              localObject = (e[])localArrayList2.toArray(new e[localArrayList2.size()]);
              arrayOfe;2[i4] = localObject;
            }
          }
          if (!bool2) {
            if (i4 < i1) {
              i1 = i4;
            }
          }
          i2 = i4;
          localObject = (e[])localArrayList1.toArray(new e[localArrayList1.size()]);
          arrayOfe;1[i4] = localObject;
          i3 += localObject.length;
        }
        i4++;
      } while (!bool1);
    } while (bool2);
    if (!bool2)
    {
      if (i3 > 0)
      {
        this.H = arrayOfe;1;
        this.L = i3;
        this.J = i1;
        this.K = i2;
        this.I = arrayOfe;2;
      }
    }
    else {
      return true;
    }
    this.L = 0;
    this.H = ((e[][])null);
    this.I = ((e[][])null);
    label391:
    label392:
    return true;
  }
  
  private final boolean a(e parame)
  {
    if (!d.R) {}
    return parame.f() < this.L;
  }
  
  private final boolean a(a.c.d paramd)
  {
    boolean bool = d.R;
    if (!bool) {
      if (paramd.e().f() >= this.L) {
        if (bool) {
          break label41;
        }
      }
    }
    label41:
    return paramd.f().f() < this.L;
  }
  
  public void a(o paramo, ac paramac, bc parambc, rb paramrb)
  {
    boolean bool3 = d.R;
    boolean bool2 = d.Q;
    this.R = ((hb)paramo.c(d.N).get(paramo));
    this.P = ((m)paramo.c(d.M).get(paramo));
    int i1 = this.a;
    if ((bool3) || (this.P != null)) {
      i1 = Math.min(this.a, 50);
    }
    k localk = paramo.c(d.K);
    boolean bool1;
    if (localk != null)
    {
      bool1 = a(paramo, paramac, localk);
      if (bool3) {
        break label118;
      }
      if (!bool2) {}
    }
    else
    {
      bool1 = false;
    }
    label118:
    if (!bool3)
    {
      if (bool1)
      {
        if (bool3) {
          break label153;
        }
        if (this.L == 0) {
          return;
        }
      }
      this.E = new z[paramac.a()];
    }
    label153:
    int i2 = 0;
    ArrayList localArrayList = new ArrayList();
    int i3 = 0;
    w localw = paramo.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      ec localec = parambc.a(localw.d());
      i3 += localec.c();
      localw.f();
      if (bool3) {
        break label268;
      }
      if (bool2) {
        break label267;
      }
    } while (!bool2);
    this.F = new int[paramo.j() + i3 / 2];
    if (!bool3) {
      this.G = new int[paramo.j() + i3 / 2];
    }
    label267:
    label268:
    int i4 = 0;
    break label353;
    label272:
    if (i4 < paramac.a()) {
      this.E[i4] = new z();
    }
    Object localObject1;
    label353:
    Object localObject2;
    label557:
    label597:
    do
    {
      i5 = 0;
      if (bool2) {
        break label775;
      }
      v localv1 = paramac.a(i4).c().f();
      do
      {
        if (localv1 == null) {
          break label674;
        }
        e locale1 = (e)localv1.c();
        localObject1 = parambc.a(locale1);
        if (bool2) {
          break label272;
        }
        if (((ec)localObject1).c() > 0)
        {
          localObject2 = ((ec)localObject1).b();
          do
          {
            if (localObject2 == null) {
              break label597;
            }
            a.c.d locald = (a.c.d)((v)localObject2).c();
            y localy = parambc.a(locald);
            if (bool2) {
              break;
            }
            if (locald.e() == locale1)
            {
              e locale2 = paramo.i();
              localArrayList.add(locale2);
              if (!bool3)
              {
                if (localy.l())
                {
                  paramrb.b(locale2, locale1, locald, false, true);
                  paramrb.a(locale2, locald.f(), locald, false, true);
                  i2 = Math.max(i2, locald.f().d());
                  if (bool3) {
                    break label557;
                  }
                  if (!bool2) {}
                }
                else
                {
                  paramrb.a(locale1, locale2, locald, true, false);
                  paramrb.b(locald.f(), locale2, locald, true, false);
                }
              }
              else {
                i2 = Math.max(i2, locald.f().e());
              }
              i2 = Math.max(2, i2);
              this.G[locale2.f()] = -1;
              this.F[locale2.f()] = (-(i4 + 1));
            }
            localObject2 = ((v)localObject2).a();
          } while (!bool2);
        }
        i2 = Math.max(i2, Math.max(locale1.d(), locale1.e()));
        this.E[i4].b(locale1);
        this.G[locale1.f()] = i5;
        this.F[locale1.f()] = i4;
        i5++;
        localv1 = localv1.a();
        if (bool3) {
          break;
        }
      } while (!bool2);
      i4++;
      if (bool3) {
        break label272;
      }
      if (!bool2) {
        break;
      }
      this.l = new z();
      this.m = new z();
      this.n = new z();
      this.o = new z();
      this.h = new e[paramo.k()];
      this.f = new float[paramo.k()];
      this.k = new v[paramo.l()];
    } while (bool3);
    label674:
    z localz = new z();
    label775:
    int i5 = paramo.l() - 1;
    do
    {
      if (i5 < 0) {
        break;
      }
      if (bool3) {
        break label858;
      }
      this.k[i5] = localz.a(null);
      localz.b();
      i5--;
      if (bool2) {
        break label857;
      }
    } while (!bool2);
    this.g = new float[i2 + 2];
    if (!bool3)
    {
      this.c = new e_(this.f);
      label857:
      label858:
      if (bool3) {
        break label992;
      }
      if (this.P != null)
      {
        this.i = new int[paramo.k()];
        this.j = new int[paramo.k()];
        this.P.a(paramo, parambc, true);
        this.P.a(paramo, this.j, this.i);
      }
    }
    else
    {
      this.Q = this.P.a(paramo, this.E, this.G);
      i5 = 0;
      do
      {
        if (i5 >= this.E.length) {
          break;
        }
        if (bool3) {
          break label1090;
        }
        a(this.E[i5], this.G, this.Q);
        i5++;
        if (bool2) {
          break label1089;
        }
      } while (!bool2);
    }
    label992:
    if ((!bool3) && (!bool3))
    {
      if (a(paramo, this.E, parambc))
      {
        this.O = new cc.j_(this.M);
        i5 = 0;
        do
        {
          if (i5 >= this.E.length) {
            break;
          }
          if (bool3) {
            break label1090;
          }
          a(this.E[i5], this.G, this.O);
          i5++;
          if (bool2) {
            break label1089;
          }
        } while (!bool2);
      }
      if (bool3) {}
    }
    else
    {
      this.D = paramo;
    }
    try
    {
      label1089:
      label1090:
      localcc = a(paramo, paramac, parambc, this.G, this.F);
      this.x = localcc.c(false);
      this.y = localcc.c(true);
      this.z = localcc.e(true);
      this.A = localcc.e(false);
      this.B = this.x;
      this.C = this.y;
      long l1 = System.currentTimeMillis();
      localObject1 = new wb(666L);
      a(paramo, this.E, this.G, null);
      this.R.a(this.E, this.G, true);
      localObject2 = new int[this.G.length];
      int i7 = a((wb)localObject1);
      if (!bool3)
      {
        a(this.G, (int[])localObject2);
        if ((System.currentTimeMillis() - l1 < this.d) && ((bool3) || (i7 > 0)))
        {
          int i8 = 0;
          label1347:
          label1607:
          label1631:
          label1633:
          do
          {
            do
            {
              if (i8 >= i1) {
                break label2043;
              }
              if (bool2) {
                break label2058;
              }
              if ((i7 <= 0) || ((!bool3) && (System.currentTimeMillis() - l1 >= this.d))) {
                break label2043;
              }
              if (!bool3) {
                if ((i8 & 0x3) < 2)
                {
                  a(paramo, this.E, this.G, (wb)localObject1);
                  if (bool3) {
                    break;
                  }
                  if (!bool2) {
                    break label1980;
                  }
                }
              }
              i9 = 0;
              if (i9 < this.E.length) {}
              while (bool3)
              {
                if (bool2) {
                  break label1867;
                }
                if (this.L == 0)
                {
                  do
                  {
                    if (bool3) {
                      break;
                    }
                    if (this.M == null)
                    {
                      if (bool3) {
                        continue;
                      }
                      if (this.P == null)
                      {
                        i10 = 0;
                        do
                        {
                          if (i10 >= this.f.length) {
                            break;
                          }
                          this.f[i10] = ((wb)localObject1).nextFloat();
                          i10++;
                          if (bool3) {
                            break label1633;
                          }
                          if (bool2) {
                            break label1631;
                          }
                        } while (!bool2);
                      }
                    }
                  } while (bool3);
                  if (this.M != null)
                  {
                    i10 = 0;
                    do
                    {
                      if (i10 >= this.f.length) {
                        break label1607;
                      }
                      int i11 = this.M[i10];
                      if (bool2) {
                        break;
                      }
                      if (i11 < 0)
                      {
                        this.f[i10] = (((wb)localObject1).nextFloat() * (this.N[i9] + 1) * 2.0F);
                        if (bool3) {
                          continue;
                        }
                        if (!bool2) {}
                      }
                      else
                      {
                        this.f[i10] = (((wb)localObject1).nextFloat() + (i11 + 1) * 2);
                      }
                      i10++;
                    } while (!bool2);
                  }
                  if (bool3) {
                    break label1347;
                  }
                  i10 = 0;
                  do
                  {
                    if (i10 >= this.f.length) {
                      break;
                    }
                    this.f[i10] = (((wb)localObject1).nextFloat() * this.i[i10] + this.j[i10]);
                    i10++;
                    if (bool3) {
                      break label1633;
                    }
                    if (bool2) {
                      break label1631;
                    }
                  } while (!bool2);
                  if (bool3) {
                    break label1969;
                  }
                  a(this.E[i9], this.G, this.c);
                  if (bool3) {
                    break label1855;
                  }
                  if (!bool2) {
                    break label1850;
                  }
                }
                int i10 = 0;
                if (!bool3)
                {
                  if (this.H[i9] != null)
                  {
                    if (bool3) {
                      break label1855;
                    }
                    if (this.H[i9].length > 0)
                    {
                      float f1 = 1.0F / (1 + this.E[i9].size() - this.H[i9].length);
                      v localv2 = this.E[i9].f();
                      if (localv2 != null) {}
                      do
                      {
                        int i12 = ((e)localv2.c()).f();
                        if (bool2) {
                          break;
                        }
                        if (i12 < this.L)
                        {
                          this.f[i12] = ((wb)localObject1).nextFloat();
                          if (bool3) {
                            break label1792;
                          }
                          if (!bool2) {}
                        }
                        else
                        {
                          this.f[i12] = (f1 * ++i10);
                        }
                        localv2 = localv2.a();
                        if (!bool2) {
                          break label1713;
                        }
                        a(this.E[i9], this.G, this.c);
                        if (bool3) {
                          break label1853;
                        }
                      } while (bool3);
                      if (this.M != null) {
                        a(this.E[i9], this.G, this.O);
                      }
                    }
                  }
                  i9++;
                }
                if (!bool2) {
                  break;
                }
              }
              if (this.L != 0)
              {
                if (bool3) {
                  break label1981;
                }
                if (this.P != null)
                {
                  this.Q = this.P.a(paramo, this.E, this.G);
                  i9 = 0;
                  do
                  {
                    if (i9 >= this.E.length) {
                      break;
                    }
                    if (bool2) {
                      break label2002;
                    }
                    if ((bool3) || (this.H[i9] != null))
                    {
                      if (bool3) {
                        continue;
                      }
                      if (this.H[i9].length > 0) {
                        a(this.E[i9], this.G, this.Q);
                      }
                    }
                    i9++;
                  } while (!bool2);
                }
              }
              this.R.a(this.E, this.G, true);
            } while (bool3);
            int i9 = a((wb)localObject1);
            if (!bool3)
            {
              if (i9 < i7)
              {
                a(this.G, (int[])localObject2);
                i7 = i9;
              }
              i8++;
            }
          } while (!bool2);
          label1713:
          label1850:
          label1853:
          label1855:
          label1867:
          label2002:
          label2043:
          if (bool3) {
            break label2081;
          }
          label1792:
          label1969:
          label1980:
          label1981:
          b((int[])localObject2);
        }
      }
      if (this.b) {
        label2058:
        if ((bool3) || (!this.R.o())) {
          label2081:
          a(this.G);
        }
      }
    }
    finally
    {
      if (!bool3) {
        if (this.P != null)
        {
          this.Q = this.P.a(paramo, this.E, this.G);
          i13 = 0;
          if (i13 < this.E.length) {}
          while (bool3)
          {
            a(this.E[i13], this.G, this.Q);
            i13++;
            if (bool3) {
              break label2204;
            }
            if (bool2) {
              break label2202;
            }
            if (!bool2) {
              break;
            }
          }
          this.P.b(paramo, parambc, false);
          label2202:
          label2204:
          if (bool3) {
            break label2270;
          }
          if (!bool2) {
            break label2269;
          }
        }
      }
      if (this.O != null)
      {
        i13 = 0;
        do
        {
          if (i13 >= this.E.length) {
            break;
          }
          a(this.E[i13], this.G, this.O);
          i13++;
          if (bool3) {
            break label2274;
          }
          if (bool2) {
            break label2272;
          }
        } while (!bool2);
      }
      label2269:
      label2270:
      int i13 = 0;
      label2272:
      label2274:
      if (i13 < localArrayList.size())
      {
        paramo.a((e)localArrayList.get(i13));
        i13++;
      }
      for (;;)
      {
        if ((bool3) || (!bool2))
        {
          if (!bool2) {
            break;
          }
          this.D = null;
          this.G = null;
          this.n = null;
          this.o = null;
          this.l = null;
          this.m = null;
          this.f = null;
          this.k = null;
          this.g = null;
          this.h = null;
          this.p = null;
          if (!bool3) {
            this.q = null;
          }
        }
      }
      cc localcc = null;
      this.c = null;
      this.r = null;
      this.s = null;
      this.x = null;
      this.y = null;
      this.z = null;
      this.A = null;
      this.B = null;
      this.C = null;
      this.O = null;
      this.M = null;
    }
    if (!bool3) {
      if (this.E != null)
      {
        int i6 = 0;
        if (i6 < paramac.a())
        {
          paramac.a(i6).a(this.E[i6]);
          i6++;
        }
        while (bool3)
        {
          if ((!bool3) && (bool2)) {
            return;
          }
          if (!bool2) {
            break;
          }
        }
        this.R.g(paramac);
      }
    }
    this.E = null;
  }
  
  boolean a(a.c.q paramq, z[] paramArrayOfz, bc parambc)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    int[] arrayOfInt = new int[paramq.j()];
    int i1 = 0;
    do
    {
      do
      {
        if (i1 >= arrayOfInt.length) {
          break;
        }
        arrayOfInt[i1] = -1;
        i1++;
        if (bool2) {
          break label62;
        }
        if (bool1) {
          break label61;
        }
      } while (!bool1);
    } while (bool2);
    i1 = 0;
    label61:
    label62:
    int i2 = -1;
    int i3 = 0;
    label196:
    label198:
    do
    {
      do
      {
        if (i3 >= paramArrayOfz.length) {
          break;
        }
        z localz = paramArrayOfz[i3];
        if (bool2) {
          break label339;
        }
        if (bool1) {
          break label338;
        }
        v localv = localz.f();
        do
        {
          if (localv == null) {
            break;
          }
          e locale = (e)localv.c();
          vc localvc = parambc.a(locale).n();
          if (bool2) {
            break label198;
          }
          if (bool1) {
            break label196;
          }
          if (!bool2)
          {
            if (localvc != null) {
              i1++;
            }
          }
          else
          {
            int i4 = localvc.j();
            arrayOfInt[locale.f()] = i4;
            i2 = Math.max(i2, i4);
          }
          localv = localv.a();
        } while (!bool1);
        if (!bool2) {
          i3++;
        }
      } while (!bool1);
    } while (bool2);
    if ((bool2) || (i1 > 0)) {
      if (!bool2)
      {
        if (i2 > 0)
        {
          this.M = arrayOfInt;
          this.N = new int[paramArrayOfz.length];
        }
      }
      else
      {
        i3 = 0;
        if (i3 < this.N.length) {}
        while (bool2)
        {
          this.N[i3] = i2;
          i3++;
          if (bool2) {
            break label327;
          }
          if (bool1) {
            break label326;
          }
          if (!bool1) {
            break;
          }
        }
        if ((bool2) || (this.R != null))
        {
          if (bool2) {
            break label327;
          }
          if (this.R.o()) {
            this.R.a(paramArrayOfz, arrayOfInt, this.N);
          }
        }
        label326:
        label327:
        return true;
      }
    }
    this.M = null;
    this.N = null;
    label338:
    label339:
    return false;
  }
  
  void a(a.c.q paramq, z[] paramArrayOfz, int[] paramArrayOfInt, wb paramwb)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    Object localObject1 = null;
    v[] arrayOfv = new v[paramq.j()];
    int[] arrayOfInt = new int[paramq.j()];
    int i1 = 0;
    Object localObject2;
    Object localObject3;
    label145:
    label147:
    do
    {
      if (i1 >= paramArrayOfz.length) {
        break;
      }
      localObject2 = paramArrayOfz[i1];
      if (bool1) {
        break label293;
      }
      if ((bool2) || (localObject1 == null)) {
        localObject1 = (e)((z)localObject2).a();
      }
      localObject3 = ((z)localObject2).f();
      do
      {
        if (localObject3 == null) {
          break;
        }
        e locale = (e)((v)localObject3).c();
        arrayOfv[locale.f()] = localObject3;
        arrayOfInt[locale.f()] = (i1 + 1);
        localObject3 = ((v)localObject3).a();
        if (bool2) {
          break label147;
        }
        if (bool1) {
          break label145;
        }
      } while (!bool1);
      if (!bool2) {
        i1++;
      }
    } while (!bool1);
    if (!bool2)
    {
      if ((bool2) || (paramwb != null))
      {
        i1 = paramwb.nextInt(paramq.j());
        localObject2 = paramq.v();
        do
        {
          if (!((w)localObject2).e()) {
            break;
          }
          localObject3 = ((w)localObject2).d();
          if ((!bool2) && (bool1)) {
            break label262;
          }
          if (!bool2) {
            if (i1 == 0)
            {
              localObject1 = localObject3;
              if (!bool2) {
                if (!bool1) {
                  break;
                }
              }
            }
            else
            {
              ((w)localObject2).f();
              i1--;
            }
          }
        } while (!bool1);
        if (!bool2) {
          a(paramq, paramwb);
        }
        label262:
        Arrays.fill(paramArrayOfInt, 0);
      }
      paramq.a(new cc.r_(this.q), new cc.r_(this.p));
    }
    label293:
    h local5 = new h()
    {
      private final v[] val$cells;
      private final int[] val$layerIndex;
      private final z[] val$layers;
      
      protected void a(e paramAnonymouse, int paramAnonymousInt)
      {
        v localv = this.val$cells[paramAnonymouse.f()];
        int i = this.val$layerIndex[paramAnonymouse.f()] - 1;
        if (i >= 0)
        {
          z localz = this.val$layers[i];
          if ((d.R) || (q.this.a(paramAnonymouse)))
          {
            localz.h(localv);
            localz.a(localv);
          }
        }
      }
    };
    local5.a(false);
    local5.b(true);
    local5.a(paramq, (e)localObject1);
    if (!bool2) {
      if (this.P != null)
      {
        this.Q = this.P.a(paramq, paramArrayOfz, paramArrayOfInt);
        i2 = 0;
        do
        {
          if (i2 >= paramArrayOfz.length) {
            break;
          }
          a(paramArrayOfz[i2], paramArrayOfInt, this.Q);
          i2++;
        } while (!bool1);
      }
    }
    if (this.O != null)
    {
      i2 = 0;
      do
      {
        if (i2 >= paramArrayOfz.length) {
          break;
        }
        a(paramArrayOfz[i2], paramArrayOfInt, this.O);
        i2++;
      } while (!bool1);
    }
    int i2 = 0;
    while (bool2) {
      while (!bool1)
      {
        if (i2 >= paramArrayOfz.length) {
          break;
        }
        a(paramArrayOfz[i2], paramArrayOfInt);
        i2++;
      }
    }
  }
  
  private int a(wb paramwb)
  {
    boolean bool3 = d.R;
    boolean bool2 = d.Q;
    qb.a();
    int i1 = 0;
    int i2 = 2147483647;
    int i3 = 2147483647;
    int[] arrayOfInt = new int[this.G.length];
    boolean bool1 = paramwb.nextBoolean();
    int i4 = 0;
    int i5 = 0;
    label138:
    label141:
    label143:
    do
    {
      do
      {
        if (i5 >= 2) {
          break;
        }
        if (bool2) {
          break label180;
        }
        if (i4 >= 6) {
          break;
        }
        if (bool3) {
          break label169;
        }
        if (i2 <= 0) {
          break;
        }
        i3 = b(bool1);
        if (!bool3)
        {
          if (i3 < i2)
          {
            i2 = i3;
            i1 = 1;
            a(this.G, arrayOfInt);
            if (bool3) {
              break label143;
            }
            if (!bool2) {
              break label141;
            }
          }
          if (bool3) {}
        }
        else
        {
          if (i3 <= i2) {
            break label138;
          }
          i5++;
        }
        if (!bool3) {
          if (bool2) {
            i4++;
          }
        }
        if (!bool3) {}
        bool1 = !bool1;
      } while (!bool2);
    } while (bool3);
    label169:
    if (!bool3) {
      if ((i1 != 0) && (i3 > i2)) {
        label180:
        b(arrayOfInt);
      }
    }
    return i2;
  }
  
  private void a(z paramz, Comparator paramComparator1, Comparator paramComparator2)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    if ((bool2) || ((paramComparator1 != null) || (paramComparator2 != null)))
    {
      v localv = paramz.f();
      do
      {
        if (localv == null) {
          break;
        }
        e locale = (e)localv.c();
        if (!bool2) {
          if (paramComparator1 != null) {
            locale.a(paramComparator1);
          }
        }
        if (paramComparator2 != null) {
          locale.b(paramComparator2);
        }
        localv = localv.a();
      } while (!bool1);
    }
  }
  
  private void a(a.c.q paramq, Comparator paramComparator1, Comparator paramComparator2)
  {
    if ((d.R) || ((paramComparator1 != null) || (paramComparator2 != null))) {
      paramq.a(paramComparator1, paramComparator2);
    }
  }
  
  private int b(boolean paramBoolean)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    if (!bool2) {
      if (this.L > 0)
      {
        if (!bool2)
        {
          if (paramBoolean)
          {
            this.R.a(Math.max(1, this.J) - 1);
            i1 = Math.max(1, this.J);
            do
            {
              if (i1 > this.K) {
                break;
              }
              if (bool1) {
                break label328;
              }
              if (this.H[i1] != null) {
                a(true, false, i1, this.E[i1], this.E[(i1 - 1)], null, this.f, this.G);
              }
              i1++;
            } while (!bool1);
          }
          this.R.a(Math.min(this.E.length - 1, this.K));
        }
        i1 = Math.min(this.E.length - 1, this.K) - 1;
        do
        {
          if (i1 < this.J) {
            break;
          }
          if (bool1) {
            break label328;
          }
          if (this.H[i1] != null) {
            a(false, true, i1, this.E[i1], null, this.E[(i1 + 1)], this.f, this.G);
          }
          i1--;
        } while (!bool1);
      }
    }
    if (!bool2)
    {
      if (paramBoolean)
      {
        this.R.a(0);
        i1 = 1;
        do
        {
          if (i1 >= this.E.length) {
            break;
          }
          a(this.E, i1, this.G);
          i1++;
          if (bool2) {
            break label367;
          }
          if (bool1) {
            break label363;
          }
        } while (!bool1);
      }
      this.R.a(this.E.length - 1);
    }
    int i1 = this.E.length - 2;
    if (i1 >= 0)
    {
      b(this.E, i1, this.G);
      i1--;
    }
    while (bool2)
    {
      if (bool2) {
        break label367;
      }
      if (bool1) {
        break label363;
      }
      if (!bool1) {
        break;
      }
    }
    label328:
    if (!bool2) {
      if (this.b)
      {
        if (bool2) {
          break label367;
        }
        if (!this.R.o()) {
          a(this.G);
        }
      }
    }
    label363:
    label367:
    return e();
  }
  
  private void a(boolean paramBoolean1, boolean paramBoolean2, int paramInt, z paramz1, z paramz2, z paramz3, float[] paramArrayOfFloat, int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    int i1 = paramz1.size();
    int i2 = i1 * 2;
    float f1 = 1.0F;
    int i3 = 0;
    Object localObject = paramz1.f();
    do
    {
      if (localObject == null) {
        break;
      }
      e locale1 = (e)((v)localObject).c();
      paramArrayOfInt[locale1.f()] = (i3 + 1);
      paramArrayOfFloat[locale1.f()] = i3;
      if (bool1) {
        break label124;
      }
      if (f1 < paramArrayOfFloat[locale1.f()]) {
        f1 = paramArrayOfFloat[locale1.f()];
      }
      localObject = ((v)localObject).a();
      i3 += 2;
    } while (!bool1);
    if ((!bool2) && (paramBoolean2)) {
      label124:
      a(paramz1, null, this.z);
    }
    if (paramBoolean1) {
      a(paramz1, this.A, null);
    }
    e[] arrayOfe = this.H[paramInt];
    localObject = this.I[paramInt];
    if (!bool2) {}
    int i4 = paramBoolean1 ? paramz2.size() : 0;
    if (!bool2) {}
    int i5 = paramBoolean2 ? paramz3.size() : 0;
    int i6 = 0;
    int i8;
    int i9;
    label319:
    label320:
    label463:
    label736:
    label744:
    do
    {
      if (i6 >= arrayOfe.length) {
        break;
      }
      e locale2 = arrayOfe[i6];
      i8 = locale2.f();
      i9 = 0;
      float f3 = 0.0F;
      if (bool1) {
        break label1307;
      }
      if (paramBoolean1)
      {
        a.c.d locald1 = locale2.i();
        if (locald1 != null) {}
        while (bool2)
        {
          f3 += a(true, locald1, i1, i2, this.G);
          locald1 = locald1.j();
          i9++;
          if (bool2) {
            break label320;
          }
          if (bool1) {
            break label319;
          }
          if (!bool1) {
            break;
          }
        }
        f3 /= i4;
      }
      float f4;
      if (!bool2) {
        if (paramBoolean2)
        {
          f4 = 0.0F;
          a.c.d locald2 = locale2.h();
          if (locald2 != null) {}
          while (bool2)
          {
            f4 += a(false, locald2, i1, i2, this.G);
            locald2 = locald2.i();
            i9++;
            if (bool2) {
              break label406;
            }
            if (bool1) {
              break label404;
            }
            if (!bool1) {
              break;
            }
          }
          f3 += f4 / i5;
        }
      }
      if ((bool2) || (i9 == 0))
      {
        f4 = this.G[i8];
        if (bool2) {
          break label463;
        }
        if (!bool1) {}
      }
      else
      {
        f3 = f3 * i2 / i9;
        f4 = f3 + this.G[i8] / 200.0F;
      }
      int i10 = 0;
      int i11 = i10;
      int i12 = -1;
      if (((bool2) || (localObject != null)) && ((bool2) || (localObject.length > 0)))
      {
        int i13 = 0;
        do
        {
          do
          {
            if (i13 >= localObject.length) {
              break;
            }
            e locale3 = localObject[i13];
            if (bool1) {
              break label1080;
            }
            if (this.P != null)
            {
              if (!bool2) {
                if (this.P.a(locale2.g(), locale3, locale2))
                {
                  i11 = i10;
                  i12 = this.G[locale3.f()] + 1;
                  if (bool2) {
                    continue;
                  }
                  if (!bool1) {
                    break label995;
                  }
                }
              }
              if (bool2) {
                break label744;
              }
              if (this.P.a(locale2.g(), locale2, locale3)) {
                break;
              }
            }
            else
            {
              if (bool2) {
                break label736;
              }
              if (this.M != null)
              {
                if (bool2) {
                  break label744;
                }
                if (this.M[i8] >= 0)
                {
                  if (bool2) {
                    break label744;
                  }
                  if (this.M[locale3.f()] >= 0)
                  {
                    if (!bool2) {
                      if (this.M[i8] > this.M[locale3.f()])
                      {
                        i11 = i10;
                        i12 = this.G[locale3.f()] + 1;
                        if (bool2) {
                          continue;
                        }
                        if (!bool1) {
                          break label995;
                        }
                      }
                    }
                    if ((!bool2) && (this.M[i8] < this.M[locale3.f()])) {
                      break;
                    }
                  }
                }
              }
            }
            int i14 = this.G[locale3.f()] - 1;
            int i15 = 0;
            if (!bool2) {
              if (paramBoolean1)
              {
                paramArrayOfInt[i8] = i14;
                a(locale2, this.A, null, true);
                i15 -= e(locale2, locale3, this.G);
                paramArrayOfInt[i8] += 2;
                a(locale2, this.A, null, true);
                i15 += e(locale3, locale2, this.G);
              }
            }
            if (!bool2)
            {
              if (paramBoolean2)
              {
                paramArrayOfInt[i8] = i14;
                a(locale2, null, this.z, true);
                i15 -= d(locale2, locale3, this.G);
                paramArrayOfInt[i8] += 2;
                a(locale2, null, this.z, true);
                i15 += d(locale3, locale2, this.G);
              }
              i10 += i15;
            }
            if (!bool2)
            {
              if (i10 < i11)
              {
                i12 = i14;
                i11 = i10;
                if (bool2) {
                  continue;
                }
                if (!bool1) {}
              }
              else
              {
                if (bool2) {
                  continue;
                }
              }
            }
            else if (i10 == i11)
            {
              if (bool2) {
                continue;
              }
              if (Math.abs(i14 - f4) < Math.abs(i12 - f4)) {
                i12 = i14;
              }
            }
            i13++;
          } while (!bool1);
          paramArrayOfFloat[i8] = (i12 + f4 / i2);
        } while (bool2);
        if (bool2) {
          break label1048;
        }
        if (!bool1) {}
      }
      else
      {
        paramArrayOfFloat[i8] = f4;
      }
      if (!bool2)
      {
        if (f1 < paramArrayOfFloat[i8]) {
          f1 = paramArrayOfFloat[i8];
        }
        i6++;
      }
    } while (!bool1);
    label404:
    label406:
    label995:
    if (!bool2)
    {
      if (this.P != null)
      {
        v localv1 = paramz1.f();
        while (localv1 != null)
        {
          int i7 = ((e)localv1.c()).f();
          paramArrayOfFloat[i7] = (paramArrayOfFloat[i7] / f1 * this.i[i7] + this.j[i7]);
          localv1 = localv1.a();
          if (bool2) {
            break label1307;
          }
          if (bool1) {
            break label1339;
          }
        }
      }
      if (!bool2) {
        if (this.M != null)
        {
          float f2 = paramz1.size() * 3;
          v localv2 = paramz1.f();
          do
          {
            if (localv2 == null) {
              break;
            }
            i8 = ((e)localv2.c()).f();
            i9 = this.M[i8];
            if (bool1) {
              break label1307;
            }
            if (i9 >= 0)
            {
              paramArrayOfFloat[i8] += (i9 + 1) * f2;
              if (bool2) {
                continue;
              }
              if (!bool1) {}
            }
            else
            {
              paramArrayOfFloat[i8] = (paramArrayOfFloat[i8] / (i2 + 1) * (this.N[paramInt] + 1) * f2);
            }
            localv2 = localv2.a();
          } while (!bool1);
        }
      }
      if (bool2) {
        break label1369;
      }
      if (this.R.o())
      {
        this.R.a(paramz1, paramInt, this.f, this.G, true);
        if (bool2) {
          break label1357;
        }
        if (!bool1) {
          break label1353;
        }
      }
    }
    label1048:
    label1080:
    label1339:
    a(paramz1, this.G, this.c);
    label1307:
    label1353:
    label1357:
    if ((bool2) || (this.b)) {
      label1369:
      if ((bool2) || (!this.R.o()))
      {
        if (!bool2) {
          if (paramBoolean1) {
            a(paramInt, paramz1, true, false, this.G);
          }
        }
        if ((bool2) || (paramBoolean2)) {
          a(paramInt, paramz1, false, true, this.G);
        }
      }
    }
  }
  
  void a(z[] paramArrayOfz, int paramInt, int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    z localz1 = paramArrayOfz[(paramInt - 1)];
    z localz2 = paramArrayOfz[paramInt];
    int i1 = localz1.size();
    int i2 = localz2.size();
    float f1 = 1.0F;
    v localv = localz2.f();
    if (localv != null) {}
    label175:
    do
    {
      e locale = (e)localv.c();
      int i4 = locale.f();
      if (bool1) {
        break label414;
      }
      switch (this.e)
      {
      case 0: 
        this.f[i4] = c(locale, i2, false, i1, paramArrayOfInt);
        if (bool2) {
          break label175;
        }
        if (!bool1) {
          break;
        }
      case 1: 
        this.f[i4] = a(locale, i2, false, i1, paramArrayOfInt);
      }
      this.f[i4] += paramArrayOfInt[i4] / (i1 * 200);
      if ((bool2) || (this.M != null))
      {
        int i5 = this.M[i4];
        if (!bool2)
        {
          if (i5 < 0) {
            this.f[i4] = (2.0F * this.f[i4] * (this.N[paramInt] + 1));
          }
        }
        else
        {
          if (bool2) {
            break label274;
          }
          if (!bool1) {
            break label264;
          }
        }
        this.f[i4] += (i5 + 1) * ((i1 + 1) * 2);
      }
      if (!bool2)
      {
        if (f1 < this.f[i4]) {
          f1 = this.f[i4];
        }
        localv = localv.a();
      }
      if (!bool1) {
        break;
      }
      if (bool2) {
        break label403;
      }
    } while (bool2);
    label264:
    label274:
    if (this.P != null)
    {
      localv = localz2.f();
      if (localv == null) {}
    }
    label403:
    while (bool2)
    {
      int i3 = ((e)localv.c()).f();
      if (bool2) {
        break label444;
      }
      this.f[i3] = (this.f[i3] / f1 * this.i[i3] + this.j[i3]);
      localv = localv.a();
      if (bool1) {
        break label443;
      }
      if (!bool1) {
        break;
      }
    }
    if (this.R.o())
    {
      label414:
      this.R.a(localz2, paramInt, this.f, paramArrayOfInt, true);
      if (bool2) {
        break label458;
      }
      if (!bool1) {}
    }
    else
    {
      label443:
      label444:
      a(localz2, paramArrayOfInt, this.c);
    }
    label458:
    if ((bool2) || (this.b)) {
      if (!bool2)
      {
        if (!this.R.o()) {
          a(localz2, this.A, null);
        }
      }
      else
      {
        a(paramInt, localz2, true, false, paramArrayOfInt);
        a(localz1, null, this.y);
      }
    }
  }
  
  void b(z[] paramArrayOfz, int paramInt, int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    z localz1 = paramArrayOfz[(paramInt + 1)];
    z localz2 = paramArrayOfz[paramInt];
    int i1 = localz1.size();
    int i2 = localz2.size();
    float f1 = 1.0F;
    v localv = localz2.f();
    if (localv != null) {}
    label175:
    do
    {
      e locale = (e)localv.c();
      int i4 = locale.f();
      if (bool1) {
        break label414;
      }
      switch (this.e)
      {
      case 0: 
        this.f[i4] = c(locale, i2, true, i1, paramArrayOfInt);
        if (bool2) {
          break label175;
        }
        if (!bool1) {
          break;
        }
      case 1: 
        this.f[i4] = a(locale, i2, true, i1, paramArrayOfInt);
      }
      this.f[i4] += paramArrayOfInt[i4] / (i1 * 200);
      if ((bool2) || (this.M != null))
      {
        int i5 = this.M[i4];
        if (!bool2)
        {
          if (i5 < 0) {
            this.f[i4] = (2.0F * this.f[i4] * (this.N[paramInt] + 1));
          }
        }
        else
        {
          if (bool2) {
            break label274;
          }
          if (!bool1) {
            break label264;
          }
        }
        this.f[i4] += (i5 + 1) * ((i1 + 1) * 2);
      }
      if (!bool2)
      {
        if (f1 < this.f[i4]) {
          f1 = this.f[i4];
        }
        localv = localv.a();
      }
      if (!bool1) {
        break;
      }
      if (bool2) {
        break label403;
      }
    } while (bool2);
    label264:
    label274:
    if (this.P != null)
    {
      localv = localz2.f();
      if (localv == null) {}
    }
    label403:
    while (bool2)
    {
      int i3 = ((e)localv.c()).f();
      if (bool2) {
        break label444;
      }
      this.f[i3] = (this.f[i3] / f1 * this.i[i3] + this.j[i3]);
      localv = localv.a();
      if (bool1) {
        break label443;
      }
      if (!bool1) {
        break;
      }
    }
    if (this.R.o())
    {
      label414:
      this.R.a(localz2, paramInt, this.f, paramArrayOfInt, false);
      if (bool2) {
        break label458;
      }
      if (!bool1) {}
    }
    else
    {
      label443:
      label444:
      a(localz2, paramArrayOfInt, this.c);
    }
    label458:
    if ((bool2) || (this.b)) {
      if (!bool2)
      {
        if (!this.R.o()) {
          a(localz2, null, this.y);
        }
      }
      else
      {
        a(paramInt, localz2, false, true, paramArrayOfInt);
        a(localz1, this.x, null);
      }
    }
  }
  
  private float a(boolean paramBoolean, a.c.d paramd, int paramInt1, int paramInt2, int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    e locale;
    int i4;
    if (!bool2) {
      if (paramBoolean)
      {
        i1 = paramd.e().f();
        if (!bool2) {
          if (this.F[i1] < 0)
          {
            if (!bool2) {}
            a.c.d locald1 = paramd.i() == null ? paramd.k() : paramd.i();
            locale = locald1.f();
            f1 = (paramInt2 - 1) * paramArrayOfInt[locale.f()] / (paramInt1 - 1);
            if ((!bool2) && (this.q == null)) {
              break label600;
            }
            if (!bool2)
            {
              switch (this.q[(i4 = locald1.d())])
              {
              case 1: 
                f1 -= 0.3F;
                if (bool2) {
                  break label199;
                }
                if (!bool1) {
                  break;
                }
              case -1: 
                f1 += 0.3F;
              }
              if (bool2) {
                break label602;
              }
              f1 -= this.s[i4] * 0.01F;
            }
            label199:
            if (!bool1) {
              break label600;
            }
          }
        }
        f1 = paramArrayOfInt[i1];
        if ((!bool2) && (this.p == null)) {
          break label600;
        }
        int i2;
        if (!bool2)
        {
          switch (this.p[(i2 = paramd.d())])
          {
          case 1: 
            f1 += 0.3F;
            if (bool2) {
              break label311;
            }
            if (!bool1) {
              break;
            }
          case -1: 
            f1 -= 0.3F;
          }
          if (bool2) {
            break label602;
          }
          f1 += this.r[i2] * 0.01F;
        }
        label311:
        if (!bool1) {
          break label600;
        }
      }
    }
    int i1 = paramd.f().f();
    if (!bool2) {
      if (this.F[i1] < 0)
      {
        if (!bool2) {}
        a.c.d locald2 = paramd.j() == null ? paramd.l() : paramd.j();
        locale = locald2.e();
        f1 = (paramInt2 - 1) * paramArrayOfInt[locale.f()] / (paramInt1 - 1);
        if ((!bool2) && (this.p == null)) {
          break label600;
        }
        if (!bool2)
        {
          switch (this.p[(i4 = locald2.d())])
          {
          case 1: 
            f1 -= 0.3F;
            if (bool2) {
              break label495;
            }
            if (!bool1) {
              break;
            }
          case -1: 
            f1 += 0.3F;
          }
          if (bool2) {
            break label602;
          }
          f1 -= this.r[i4] * 0.01F;
        }
        label495:
        if (!bool1) {
          break label600;
        }
      }
    }
    float f1 = paramArrayOfInt[i1];
    if ((bool2) || (this.q != null))
    {
      int i3;
      if (!bool2) {}
      switch (this.q[(i3 = paramd.d())])
      {
      case 1: 
        if (!bool2)
        {
          f1 += 0.3F;
          if (!bool1) {
            break;
          }
        }
        break;
      case -1: 
        f1 -= 0.3F;
      }
      f1 += this.s[i3] * 0.01F;
    }
    label600:
    label602:
    return f1;
  }
  
  private float a(e parame, int paramInt1, boolean paramBoolean, int paramInt2, int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    int i1 = 0;
    if (paramBoolean)
    {
      locald = parame.h();
      do
      {
        if (locald == null) {
          break;
        }
        this.g[i1] = a(false, locald, paramInt1, paramInt2, paramArrayOfInt);
        locald = locald.i();
        i1++;
        if (bool2) {
          break label214;
        }
        if (bool1) {
          break label210;
        }
      } while (!bool1);
    }
    a.c.d locald = parame.i();
    if (locald != null)
    {
      this.g[i1] = a(true, locald, paramInt1, paramInt2, paramArrayOfInt);
      locald = locald.j();
      i1++;
    }
    for (;;)
    {
      if (!bool2) {
        if (!bool1)
        {
          if (!bool1) {
            break;
          }
          if (bool2) {
            continue;
          }
          if ((bool2) || (i1 == 0))
          {
            i2 = paramArrayOfInt[parame.f()];
            if (!bool2) {
              if (i2 == 0) {
                return -1.0F;
              }
            }
            if (!bool2) {
              if (i2 >= paramInt1 - 1) {
                return paramInt2;
              }
            }
            return (paramInt2 - 1) * paramArrayOfInt[parame.f()] / (paramInt1 - 1);
          }
          Arrays.sort(this.g, 0, i1);
        }
      }
    }
    label210:
    label214:
    int i2 = i1 >> 1;
    if (!bool2) {
      if (i1 % 2 == 1) {
        return this.g[i2];
      }
    }
    if (i1 == 2) {
      return (this.g[0] + this.g[1]) * 0.5F;
    }
    float f1 = this.g[(i2 - 1)] - this.g[0];
    float f2 = this.g[(i1 - 1)] - this.g[i2];
    if (!bool2) {
      if (f1 == 0.0F)
      {
        if (bool2) {
          break label370;
        }
        if (f2 == 0.0F) {
          break label351;
        }
      }
    }
    return (this.g[(i2 - 1)] * f2 + this.g[i2] * f1) / (f1 + f2);
    label351:
    label370:
    return (this.g[(i2 - 1)] + this.g[i2]) * 0.5F;
  }
  
  private float c(e parame, int paramInt1, boolean paramBoolean, int paramInt2, int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    float f1 = 0.0F;
    if (!bool2) {}
    int i1 = paramBoolean ? parame.e() : parame.d();
    if (!bool2) {
      if (i1 == 0)
      {
        int i2 = paramArrayOfInt[parame.f()];
        if (!bool2) {
          if (i2 == 0) {
            return -1.0F;
          }
        }
        if (!bool2) {
          if (i2 >= paramInt1 - 1) {
            return paramInt2;
          }
        }
        return (paramInt2 - 1) * paramArrayOfInt[parame.f()] / (paramInt1 - 1);
      }
    }
    if (paramBoolean)
    {
      locald = parame.h();
      do
      {
        if (locald == null) {
          break;
        }
        if (bool2) {
          break label222;
        }
        f1 += a(false, locald, paramInt1, paramInt2, paramArrayOfInt);
        locald = locald.i();
        if (bool1) {
          break label220;
        }
      } while (!bool1);
    }
    a.c.d locald = parame.i();
    if (locald != null) {}
    for (;;)
    {
      if (!bool2)
      {
        f1 += a(true, locald, paramInt1, paramInt2, paramArrayOfInt);
        locald = locald.j();
        if (!bool1)
        {
          if (!bool1) {
            break;
          }
          if (bool2) {
            continue;
          }
          f1 /= i1;
        }
      }
    }
    label220:
    label222:
    return f1;
  }
  
  private final void a(z paramz, int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    int i1 = 0;
    v localv = paramz.f();
    do
    {
      while (!bool1)
      {
        if (localv == null) {
          break;
        }
        paramArrayOfInt[((e)localv.c()).f()] = (i1++);
        localv = localv.a();
      }
    } while (bool2);
  }
  
  private final void a(int[] paramArrayOfInt1, int[] paramArrayOfInt2)
  {
    System.arraycopy(paramArrayOfInt1, 0, paramArrayOfInt2, 0, paramArrayOfInt1.length);
  }
  
  private final void b(int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    a(paramArrayOfInt, this.G);
    do
    {
      for (int i1 = 0; !bool1; i1++)
      {
        if (i1 >= this.E.length) {
          break;
        }
        b(this.E[i1], this.G);
      }
    } while (bool2);
  }
  
  private final void b(z paramz, int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    v localv = paramz.f();
    do
    {
      if (localv == null) {
        break;
      }
      localObject = (e)localv.c();
      this.h[paramArrayOfInt[localObject.f()]] = localObject;
      localv = localv.a();
    } while (!bool1);
    int i1 = 0;
    Object localObject = paramz.f();
    do
    {
      while (!bool1)
      {
        if (localObject == null) {
          break;
        }
        ((v)localObject).a(this.h[i1]);
        localObject = ((v)localObject).a();
        i1++;
      }
    } while (bool2);
  }
  
  private final void a(z paramz, int[] paramArrayOfInt, Comparator paramComparator)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    int i1 = 0;
    v localv = paramz.f();
    do
    {
      do
      {
        if (localv == null) {
          break;
        }
        this.h[i1] = ((e)localv.c());
        if (bool2) {
          break label89;
        }
        localv = localv.a();
        i1++;
        if (bool1) {
          break label85;
        }
      } while (!bool1);
      l.a(this.h, 0, paramz.size(), paramComparator);
    } while (bool2);
    i1 = 0;
    label85:
    label89:
    localv = paramz.f();
    do
    {
      if (localv == null) {
        break;
      }
      e locale = this.h[i1];
      localv.a(locale);
      paramArrayOfInt[locale.f()] = i1;
      localv = localv.a();
      i1++;
    } while (!bool1);
  }
  
  static class d_
    implements Comparator
  {
    final byte[] a;
    final byte[] b;
    final int[] d;
    final int[] e;
    final int[] g;
    
    d_(int[] paramArrayOfInt1, byte[] paramArrayOfByte1, int[] paramArrayOfInt2, byte[] paramArrayOfByte2, int[] paramArrayOfInt3)
    {
      this.g = paramArrayOfInt1;
      this.a = paramArrayOfByte1;
      this.b = paramArrayOfByte2;
      this.d = paramArrayOfInt2;
      this.e = paramArrayOfInt3;
    }
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      boolean bool = d.R;
      a.c.d locald1 = (a.c.d)paramObject1;
      a.c.d locald2 = (a.c.d)paramObject2;
      int i;
      int k = this.b[(i = locald1.d())];
      int j;
      int m = this.b[(j = locald2.d())];
      int n = l.a(k, m);
      if (!bool) {
        if (n != 0) {
          return n;
        }
      }
      int i1 = this.e[i];
      int i2 = this.e[j];
      if (!bool) {
        if (i1 > 0)
        {
          if (!bool) {
            if (i2 > 0) {
              return l.a(i1, i2);
            }
          }
          return -1;
        }
      }
      if (!bool) {
        if (i2 > 0) {
          return 1;
        }
      }
      int i3 = l.a(this.g[locald1.e().f()], this.g[locald2.e().f()]);
      if (!bool) {
        if (i3 != 0) {
          return i3;
        }
      }
      int i4 = l.a(this.a[i], this.a[j]);
      if (!bool) {
        if (i4 != 0) {
          return i4;
        }
      }
      int i5 = this.d[i];
      int i6 = this.d[j];
      if (!bool) {
        if (i5 > 0)
        {
          if (!bool) {
            if (i6 > 0) {
              return l.a(i5, i6);
            }
          }
          return -1;
        }
      }
      if (!bool) {
        if (i6 > 0) {
          return 1;
        }
      }
      return 0;
    }
  }
  
  static final class c_
    implements Comparator
  {
    final byte[] a;
    final byte[] b;
    final int[] d;
    final int[] e;
    final int[] g;
    
    c_(int[] paramArrayOfInt1, byte[] paramArrayOfByte1, int[] paramArrayOfInt2, byte[] paramArrayOfByte2, int[] paramArrayOfInt3)
    {
      this.g = paramArrayOfInt1;
      this.a = paramArrayOfByte1;
      this.b = paramArrayOfByte2;
      this.d = paramArrayOfInt2;
      this.e = paramArrayOfInt3;
    }
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      boolean bool = d.R;
      a.c.d locald1 = (a.c.d)paramObject1;
      a.c.d locald2 = (a.c.d)paramObject2;
      int i;
      int k = this.a[(i = locald1.d())];
      int j;
      int m = this.a[(j = locald2.d())];
      int n = l.a(k, m);
      if (!bool) {
        if (n != 0) {
          return n;
        }
      }
      int i1 = this.d[i];
      int i2 = this.d[j];
      if (!bool) {
        if (i1 > 0)
        {
          if (!bool) {
            if (i2 > 0) {
              return l.a(i1, i2);
            }
          }
          return -1;
        }
      }
      if (!bool) {
        if (i2 > 0) {
          return 1;
        }
      }
      int i3 = l.a(this.g[locald1.f().f()], this.g[locald2.f().f()]);
      if (!bool) {
        if (i3 != 0) {
          return i3;
        }
      }
      int i4 = l.a(this.b[i], this.b[j]);
      if (!bool) {
        if (i4 != 0) {
          return i4;
        }
      }
      int i5 = this.e[i];
      int i6 = this.e[j];
      if (!bool) {
        if (i5 > 0)
        {
          if (!bool) {
            if (i6 > 0) {
              return l.a(i5, i6);
            }
          }
          return -1;
        }
      }
      if (!bool) {
        if (i6 > 0) {
          return 1;
        }
      }
      return 0;
    }
  }
  
  static final class e_
    implements Comparator
  {
    final float[] a;
    
    e_(float[] paramArrayOfFloat)
    {
      this.a = paramArrayOfFloat;
    }
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      return l.a(this.a[((e)paramObject1).f()], this.a[((e)paramObject2).f()]);
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.d.a.q

 * JD-Core Version:    0.7.0.1

 */